<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>站内信管理</title> <#include "/WEB-INF/content/module-index.html">
<script type="text/javascript">
var oper=[
      	{"id":"0","text":"未推送"},
      	{"id":"1","text":"已推送"}
      ];

$(function(){
	$("#search").click(function(){
		$("#grid").datagrid("reload");		
	});	
});

function statusFormatter(value,rowData,rowIndex){
	if(value==0){
		return "未推送";
	}else
		if(value==1){
			return "已推送";
		}else
			return "未知";
}

function myEdit(){
	var baseUrl = moduleUrl.substring(0,moduleUrl.lastIndexOf("/") );
	var parent = "";
	if (hasParent())
		parent = "_" + parentId;
	var row = $("#grid").datagrid('getSelected');
	if(row.status==1){
		top.showMsg("该消息已推送");
	}else{
		top.openModule("message_message-edit", moduleName + "-编辑", baseUrl + "/"
				+ getSelectItemId()+ "/edit");
	}
}
</script>
<style>
a.btn-border{
	border: 1px solid #ccc;
}
</style>
</head>
<body>
<body class="easyui-layout">
	<div region="center" style="padding: 5px; background:#eee;">
		<div id="toolbar">	
			<@auth code="message:notice:new">
				<a id="new" class="easyui-linkbutton" onclick="javascript:add();" icon="icon-add" style="border: 1px solid #ccc" plain="true">新增</a>
			</@auth>
			<@auth code="message:notice:*:edit">
				<a id="edit" class="easyui-linkbutton" onclick="javascript:myEdit();" icon="icon-edit" style="border: 1px solid #ccc" plain="true">编辑</a>
			</@auth>
		</div>
		<table id="grid" class="easyui-datagrid" url="query" align="center" idField="mid" rownumbers="true" striped="true" fitColumns="true" fit="true" pagination="true" singleSelect="true" toolbar="#toolbar">
			<thead>
				<tr>
					<th field="title" width="20">标题</th>
					<th field="creator" width="10">创建人</th>
					<th field="createtime" width="10" align='center'>创建时间</th>
				</tr>
			</thead>
		</table>
	</div>
</body>
</body>

</html>